<!-- <template>
	首页大banner图组件
	<view class="swiper-wrap" style="width: 710rpx;height: 400rpx;margin-top: 30rpx;">
		图片位置
		<swiper autoplay @change="change">
			<swiper-item v-for="(item, index) in list" :key="index">
				<image mode="aspectFill" :src="item.image + '?x-oss-process=image/resize,w_1200'"  :style="imageStyle" class="slide-image" :data-item="item" @tap="handleClick" />
			</swiper-item>
		</swiper>
		轮播图小点样式自定义
		<view class="dots" :style="dotListStyle">
			<view class="dot-item" :class="{active:current===index}" v-for="(item,index) in list" :key="index"></view>
		</view>
	</view>
</template>
	
<script>
	export default {
		name: "Banner",
		props: {
			list: {
				type: Array
			},
			iStyle: {
				type: String
			},
			imageStyle: {
				type: String
			},
			dotListStyle: {
				type: String
			}
		},
		data() {
			return {
				current: 0
			}
		},
		methods: {
			// 当图片发生改变时
			change(e) {
				// this.current指的是图片下标
				// console.log(e);
				this.current = e.detail.current
			},
			handleClick(e) {
				let item = e.currentTarget.dataset.item
				let link = item.link || {}
				this.toLink(link)
			}
		}
	}
</script>

<style lang="scss" scoped>
	uni-view {
	    display: block;
	}
	.swiper-wrap {
		width: 98%;
		height: 95%;
		margin-left: 20rpx;
		position: relative;
		// border-radius: 20rpx;
		top:30rpx;
		swiper {
			height: 95%;
			image {
				width: 100%;
				height: 100%;
				// border-radius: 20rpx;
			}
		}
	}

	.dots {
		position: absolute;
		left: 0;
		bottom: 0rpx;
		width: 100%;
		height: 8rpx;
		display: flex;
		justify-content: center;

		.dot-item {
			margin: 0 6rpx;
			width: 10rpx;
			height: 10rpx;
			// border-radius: 50%;
			background-color: rgba(255, 255, 255, 0.6);
			transition: all 0.4s;

			&.active {
				// border-radius: 6rpx;
				width: 26rpx;
				background-color: #FD9D11;
			}
		}
	}
</style> -->
<template>
  <view class="container">
    <swiper class="slider" :current="currentIndex" @change="swiperChange">
      <swiper-item v-for="(image, index) in images" :key="index">
        <image :src="image" mode="widthFix" style="margin-left: 30rpx;width: 690rpx;border-radius: 10rpx;" :class="{ 'animated-slide-out': currentIndex === index, 'animated-slide-in': currentIndex !== index }"></image>
      </swiper-item>
    </swiper>
  </view>
</template>

<script>
	export default {
		data() {
			return {
				currentIndex: 0,
				images: ["https://bus-cdn.hquesoft.com/box/img/other/TyRVcflROXdQm7yCyFM1hLadcT4jvF9dCUhZuJAm.png", "https://bus-cdn.hquesoft.com/box/img/other/BL07VSAre0U5Kj0QQvMOsDRj8lLJsaWCHZi1hU4q.png"] // 替换为实际的图片路径
			};
		},
		methods: {
			swiperChange(event) {
				this.currentIndex = event.detail.current;
			}
		}
	};
</script>

<style scoped>
  @keyframes slideOut {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(0.95);
    }
    100% {
      transform: scale(1);
    }
  }


  .container {
    width: 100%;
    height: 480rpx;
    overflow: hidden;
    margin-top: 80rpx;
	border-radius: 10rpx;
  }

  .slider {
    width: 100%;
    height: 100%;
  }

  .animated-slide-out {
    animation: slideOut 0.8s ease-in-out;
  }

  .animated-slide-in {
    animation: slideIn 0.8s ease-in-out;
  }
</style>